<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2023/6/5
 * Time: 19:47
 */

namespace app\controller\index\production;


use app\controller\CoreController;
use app\logic\index\production\ProductLogic;
use support\Request;

class IndexController extends CoreController
{
    public function getList(Request $request)
    {
        $param = [];

        $data = ProductLogic::getInstance()->getList($param);
        return $this->endSuccess($data);
    }

    public function getDetail(Request $request)
    {
        try{
            $param = [];
            $param['production_sn'] = $request->input('production_sn');
            if(empty($param['production_sn'])){
                throw new IndexException(4020,'商品不存在');
            }
            $data = ProductLogic::getInstance()->getDetail($param);
            return $this->endSuccess($data);
        }catch (IndexException $e){
            return $this->endError($e);
        }
    }
}